

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Testing - Windows &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="Ceph Dashboard Developer Documentation" href="../dash-devel/" />
    <link rel="prev" title="Running Unit Tests" href="../running-tests-locally/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">向 Ceph 贡献：开发者指南</a></li>
      <li class="breadcrumb-item active">Testing - Windows</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/dev/developer_guide/tests-windows.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">开发者指南</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../intro/">简介</a></li>
<li class="toctree-l2"><a class="reference internal" href="../essentials/">必备知识</a></li>
<li class="toctree-l2"><a class="reference internal" href="../merging/">何时、合并了什么</a></li>
<li class="toctree-l2"><a class="reference internal" href="../issue-tracker/">问题追踪器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../basic-workflow/">基本工作流</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tests-unit-tests/">测试：单元测试</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing_integration_tests/">测试：集成测试(Teuthology)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../running-tests-locally/">测试：在本地运行测试</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">测试: Windows</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#windows-ci-job">Windows CI Job</a></li>
<li class="toctree-l3"><a class="reference internal" href="#frequently-asked-questions">Frequently asked questions</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../dash-devel/">Ceph Dashboard 开发者文档 (之前是 HACKING.rst)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../jaegertracing/">Tracing 开发者文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cephadm/">Cephadm 开发者文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../debugging-gdb/">用 GDB 调试</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="testing-windows">
<span id="dev-testing-windows"></span><h1>Testing - Windows<a class="headerlink" href="#testing-windows" title="Permalink to this heading"></a></h1>
<p>Since Pacific, the Ceph client tools and libraries can be natively used on
Windows. This allows Windows nodes to consume Ceph without additional layers
such as iSCSI gateways or SMB shares.</p>
<p>A significant amount of unit tests and integration tests were ported in order
to ensure that these components continue to function properly on Windows.</p>
<section id="windows-ci-job">
<h2>Windows CI Job<a class="headerlink" href="#windows-ci-job" title="Permalink to this heading"></a></h2>
<p>The <a class="reference external" href="https://github.com/ceph/ceph-build/blob/main/ceph-windows-pull-requests/config/definitions/ceph-windows-pull-requests.yml">Windows CI job</a> performs the following steps for each GitHub pull request:</p>
<ul class="simple">
<li><p>spin up a Linux VM in which to build the server-side (Linux) Ceph binaries
and cross-compile the Windows (client) binaries.</p></li>
<li><p>recreate the Linux VM and start a Ceph vstart cluster</p></li>
<li><p>boot a Windows VM and run the Ceph tests there</p></li>
</ul>
<p><a class="reference external" href="https://github.com/ceph/ceph-win32-tests/">A small PowerShell framework</a> parallelizes the tests, aggregates the results
and isolates or skips certain tests that are known to be flaky.</p>
<p>The console output can contain compilation errors as well as the name of the
tests that failed. To get the console output of the failing tests as well as
Ceph and operating system logs, please check the build artifacts from the
Jenkins “Status” page.</p>
<img alt="../../../_images/windows_ci_status_page.png" class="align-center" src="../../../_images/windows_ci_status_page.png" />
<p>The Windows CI artifacts can be downloaded as a zip archive or viewed inside
the browser. Click the “artifacts” button to see the contents of the artifacts
folder.</p>
<img alt="../../../_images/windows_ci_artifacts.png" class="align-center" src="../../../_images/windows_ci_artifacts.png" />
<p>Artifact contents:</p>
<ul class="simple">
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">client/</span></code> - Ceph client-side logs (Windows)</dt><dd><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">eventlog/</span></code> - Windows system logs</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">logs/</span></code> - Ceph logs</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">-windows.conf</span></code> - Ceph configuration file</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">cluster/</span></code> - Ceph server-side logs (Linux)</dt><dd><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">ceph_logs/</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">journal</span></code></p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">test_results/</span></code></dt><dd><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">out/</span></code> - raw and xml test output grouped by the test executable</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">test_results.html</span></code> - aggregated test report (html)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">test_results.txt</span></code> - aggregated test report (plaintext)</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>We’re using the <a class="reference external" href="https://github.com/testing-cabal/subunit">subunit</a> format and associated tools to aggregate the test
results, which is especially handy when running a large amount of tests in
parallel.</p>
<p>The aggregated test report provides a great overview of the failing tests.
Go to the end of the file to see the actual errors:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="mi">0</span><span class="p">}</span> <span class="n">unittest_mempool</span><span class="o">.</span><span class="n">mempool</span><span class="o">.</span><span class="n">bufferlist_reassign</span> <span class="p">[</span><span class="mf">0.000000</span><span class="n">s</span><span class="p">]</span> <span class="o">...</span> <span class="n">ok</span>
<span class="p">{</span><span class="mi">0</span><span class="p">}</span> <span class="n">unittest_mempool</span><span class="o">.</span><span class="n">mempool</span><span class="o">.</span><span class="n">bufferlist_c_str</span> <span class="p">[</span><span class="mf">0.006000</span><span class="n">s</span><span class="p">]</span> <span class="o">...</span> <span class="n">ok</span>
<span class="p">{</span><span class="mi">0</span><span class="p">}</span> <span class="n">unittest_mempool</span><span class="o">.</span><span class="n">mempool</span><span class="o">.</span><span class="n">btree_map_test</span> <span class="p">[</span><span class="mf">0.000000</span><span class="n">s</span><span class="p">]</span> <span class="o">...</span> <span class="n">ok</span>
<span class="p">{</span><span class="mi">0</span><span class="p">}</span> <span class="n">ceph_test_dokan</span><span class="o">.</span><span class="n">DokanTests</span><span class="o">.</span><span class="n">test_mount</span> <span class="p">[</span><span class="mf">9.203000</span><span class="n">s</span><span class="p">]</span> <span class="o">...</span> <span class="n">FAILED</span>

<span class="n">Captured</span> <span class="n">details</span><span class="p">:</span>
<span class="o">~~~~~~~~~~~~~~~~~</span>
    <span class="sa">b</span><span class="s1">&#39;/home/ubuntu/ceph/src/test/dokan/dokan.cc:136&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;Expected equality of these values:&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;  wait_for_mount(mountpoint)&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;    Which is: -138&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;  0&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;/home/ubuntu/ceph/src/test/dokan/dokan.cc:208&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;Expected equality of these values:&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;  ret&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;    Which is: &quot;ceph-dokan: exit status: -22&quot;&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;  &quot;&quot;&#39;</span>
    <span class="sa">b</span><span class="s1">&#39;Failed unmapping: Y:</span><span class="se">\\</span><span class="s1">&#39;</span>
<span class="p">{</span><span class="mi">0</span><span class="p">}</span> <span class="n">ceph_test_dokan</span><span class="o">.</span><span class="n">DokanTests</span><span class="o">.</span><span class="n">test_mount_read_only</span> <span class="p">[</span><span class="mf">9.140000</span><span class="n">s</span><span class="p">]</span> <span class="o">...</span> <span class="n">FAILED</span>
</pre></div>
</div>
<p>The html report conveniently groups the test results by test suite (test binary).
For security reasons it isn’t rendered by default but it can be downloaded and
viewed locally:</p>
<img alt="../../../_images/windows_ci_html_report.png" class="align-center" src="../../../_images/windows_ci_html_report.png" />
<p>Timeouts and missing test results are often an indication that a process crashed.
Note that the ceph status is printed out on the console before and after
performing the tests, which can help identify crashed services.</p>
<p>You may also want to check the service logs (both client and server side). Also,
be aware that the Windows “application” event log will contain entries in case
of crashed Windows processes.</p>
</section>
<section id="frequently-asked-questions">
<h2>Frequently asked questions<a class="headerlink" href="#frequently-asked-questions" title="Permalink to this heading"></a></h2>
<ol class="arabic simple">
<li><p>Why is the Windows CI job the only one that fails on my PR?</p></li>
</ol>
<p>Ceph integration tests are normally performed through Teuthology on the Ceph
Lab infrastructure. These tests are triggered on-demand by the Ceph QA
team and do not run automatically for every submitted pull request.</p>
<p>Since the Windows CI job focuses only on the client-side Ceph components,
it can run various integration tests in a timely manner for every pull request
on GitHub. <strong>In other words, it runs various librados, librbd and libcephfs
tests that other checks such as “make check” do not.</strong></p>
<p>For this reason, the Windows CI often catches regressions that are missed by the
other checks and would otherwise only come up through Teuthology. More often
than not, these regressions are not platform-specific and affect Linux as well.</p>
<p>In case of Windows CI failures, we strongly suggest checking the test results
as described above.</p>
<p>Be aware that the <a class="reference external" href="https://github.com/ceph/ceph/blob/main/win32_build.sh">Windows build script</a> may use different compilation flags
and <code class="docutils literal notranslate"><span class="pre">-D</span></code> options passed to CMake. For example, it defaults to <code class="docutils literal notranslate"><span class="pre">Release</span></code> mode
instead of <code class="docutils literal notranslate"><span class="pre">Debug</span></code> mode. At the same time, it uses a different toolchain
(<code class="docutils literal notranslate"><span class="pre">mingw-llvm</span></code>) and a separate set of <a class="reference external" href="https://github.com/ceph/ceph/blob/main/win32_deps_build.sh">dependencies</a>, make sure to bump the
versions if needed.</p>
<ol class="arabic simple" start="2">
<li><p>Why is the Windows CI job mandatory?</p></li>
</ol>
<p>The test job was initially optional, as a result regressions were introduced
very often.</p>
<p>After a time, Windows support became mature enough to make this CI job mandatory.
This significantly reduces the amount of work required to address regressions
and assures Ceph users of continued Windows support.</p>
<p>As said before, another great advantage is that it runs integration tests that
quickly catch regressions which often affect Linux builds as well. This spares
developers from having to wait for the full Teuthology results.</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../running-tests-locally/" class="btn btn-neutral float-left" title="Running Unit Tests" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../dash-devel/" class="btn btn-neutral float-right" title="Ceph Dashboard Developer Documentation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>